package top.greatxiaozou.abstractFactorPattern;

public class AbsFactorDemo {
    public static void main(String[] args) {
        AbsractFactor colorFactor = FactorBuilder.getFactor("color");
        AbsractFactor shapeFactor = FactorBuilder.getFactor("shape");

        Color red = colorFactor.getColor("red");
        Color blue = colorFactor.getColor("blue");
        Color green = colorFactor.getColor("green");

        red.fill();
        blue.fill();
        green.fill();

        Shape circle = shapeFactor.getShape("circle");
        Shape rectangle = shapeFactor.getShape("rectangle");
        Shape square = shapeFactor.getShape("square");

        circle.draw();
        rectangle.draw();
        square.draw();

    }
}
